package com.ssh.service;

import com.ssh.dao.IUserInfoDAO;
import com.ssh.model.UserInfo;

public class UserInfoService implements IUserInfoService {
    private IUserInfoDAO userInfoDAO;
	@Override
	public void saveUserInfo(UserInfo userInfo) {
		try{
			userInfoDAO.saveUserInfo(userInfo);
		}catch(Exception e){
			e.printStackTrace();
		}
		
	}

	@Override
	public UserInfo findUserInfoById(long id) {
	     UserInfo userInfo=null;
	     try{
	    	 userInfo= userInfoDAO.findUserInfoById(id);
	     }catch(Exception e){
	    	 e.printStackTrace();
	     }
	     return userInfo;
		
	}
	@Override
	public UserInfo finUserInfoByUsername(String username) {
		
		return userInfoDAO.findUserInfoByUserName(username); 
	}
	public IUserInfoDAO getUserInfoDAO() {
		return userInfoDAO;
	}

	public void setUserInfoDAO(IUserInfoDAO userInfoDAO) {
		this.userInfoDAO = userInfoDAO;
	}


   
}
